<?php if($this->citys):?>
	<?php $data=array();
	 foreach ($this->citys as $city){
	 	$letter=mb_substr($city['label'],0,1,'utf-8');
	 	if($city['sortable']==0){
	 		$data['#'][]=$city;
	 	}
	 	$data[$letter][]=$city;
	 	
	 }
		
	 	/*
	 	 * Количество городов в колонке
	 	 */
	 	$columnsize=26;
	 	
	 	
	 	
	 	ksort($data);
		$counter=0;
		$close=true;
		
	?>
	
	<div id="citylist" class="clearfix">
	<?php $ru = false;?>
	<?php $ru_counter = 0;?>
	<h3>Выберите город</h3>
		<?php foreach ($data as $letter=>$towns):?>
				<?php 
					if($counter==0){
						echo "<div class='column'>";
						$close=false;
						if (! $ru):?>
							<h4>Россия</h4>
						<?php
						$ru = true;
						endif; 
					}
				?>
				<?php $ru_counter++;?>
				 <div class="letter_block">
				 <?php if($letter!='#'): ?>
				 	<span class="letter"><?=$letter ?></span>
				 <?php endif;?>
				 
				<?php foreach ($towns as $city):?>
					<?php $counter++;?>
					<?php if($city['id']==$this->current){
						$class="class='active'";
					}else{
						$class="";
					}?>
					<a <?=$class ?> rel="<?=$city['alias']?>" href="<?=$this->url(array('city'=>$city['alias']),'salon')?>"><?=$city['label'] ?></a>
				<?php endforeach;?>
				</div>
				<?php if ($ru_counter == count($data)): //Рендер казахстана?>
					<?php if ($this->kaz_citys):?>
					<h4>Казахстан</h4>
					<div class="letter_block">
					<?php 
					 $data=array();
					 foreach ($this->kaz_citys as $city){
					 	$data[$city['label']]=$city;
					 }
					 ksort($data);
					?>
					<?php foreach ($data as $towns):?>
						<?php if($towns['id']==$this->current){
							$class="class='active'";
						}else{
							$class="";
						}?>
						<a <?=$class ?> rel="<?=$towns['alias']?>" href="<?=$this->url(array('city'=>$city['alias']),'salon')?>"><?=$towns['label'] ?></a>
					<?php endforeach;?>
					</div>
					<?php endif;?>
					<?php break; ?>
				<?php endif;?>
				<?php 
					if(($counter>=$columnsize)&&($close==false)){
						echo "</div>";
						$close=true;
						$counter=0;
					}
				?>
					
				
		<?php endforeach;?>
		
		<?php 
			if($close==false){
				echo "</div>";
				$close=true;
				$counter=0;
			}
		?>
		
	</div>
<?php endif;?>